package service.impl;

import java.util.List;

import dao.ProductDao;
import dao.impl.ProductDaoImpl;
import pojo.Product;
import service.ProductManager;

public class ProductManagerImpl implements ProductManager {

	private ProductDao dao = new ProductDaoImpl();
	@Override
	public int deleteProduct(String pid) {
		return dao.deleteProduct(pid);
	}

	@Override
	public int updateProduct(Product p) {
		return dao.updateProduct(p);
	}

	
	@Override
	public int addProduct(Product p) {
		return (dao.addProduct(p) != null) ? 1 : 0;
	}

	@Override
	public List<Product> findAllProduct(String wid) {
		return dao.findAllProduct(wid);
	}
	
	@Override
	public Product getProduct(String pid) {
		return dao.searchProdut(pid);
	}

}
